package biz.inv.mgbean;

import biz.inv.dto.Balance;
import biz.inv.service.BalanceSvr;
import glen.util.BaseManageBean;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;


/**
 * Created by Test on 3/8/14.
 */
@ManagedBean(name = "balanceMgb")
@ViewScoped
public class BalanceMgb extends BaseManageBean<Balance, BalanceSvr> {

    private String searchProductCode;
    private String searchProductName;


    public BalanceMgb() throws InstantiationException, IllegalAccessException {
        super(Balance.class, BalanceSvr.class);
    }


    public String getSearchProductCode() {
        return searchProductCode;
    }

    public void setSearchProductCode(String searchProductCode) {
        this.searchProductCode = searchProductCode;
    }


    public String getSearchProductName() {
        return searchProductName;
    }

    public void setSearchProductName(String searchProductName) {
        this.searchProductName = searchProductName;
    }


    public void search() {
        Balance o = new Balance();
        o.getProduct().setName(searchProductName);
        o.getProduct().setCode(searchProductCode);
        resultSearch = svr.search(o);
    }

    public void reset() {
        resultSearch = null;
        searchProductName = null;
        searchProductCode = null;

    }
}
